Even better solution, which doesn't involve disabling SIP:
spctl developer-mode enable-terminal
This is in a regular Terminal window, not in recovery mode. Next, go to System Preferences - Security & Privacy - Privacy, and scroll down till you see an entry for "Developer Tools". Authenticate, tick the checkbox next to Terminal, and done!
Topic:
Code Signing
SubTopic:
General
Tags: